local localizedClass, englishClass = UnitClass("player");
if (englishClass == "MAGE") then

facerollgcdcheck.MageFire_0 = 30455
facerollgcdcheck.MageFrost_0 = 30455
facerollgcdcheck.MageArcane_0 = 30455

	facerolldb["MageArcane_0"] = 
	{
	--[[	arkanemacht = 
		{
			id=12042,
			icon=12042,
			casttime=0,
			cd=90,
			prio=100,
				selfbuff = {
				id = 83098,
				count = 1,
			},	
		},]]
	--[[	hervorufung = 
		{
			id=12051,
			icon=12051,
			casttime=6,
			prio=90,
				cd=120,
			power = {
				minp = 0,
				maxp = 30,
			},
		},
		arkanschlag = 
		{
			id=12051,
			icon=30451,
			cd=1,
			casttime=1.5,
			prio=80,
			resource=870,
		},
		arkanschlag2 = 
		{
			id=30451,
			icon=30451,
			casttime=1.5,
			prio=75,
			resource=0,
			selfbuff = {
				id = 12536,
				count = 1,
				proc = true,
			},

		},]]
		arkanschlag3 = 
		{
			id=30451,
			icon=30451,
			casttime=1.5,
			prio=70,
			resource=870,
			power = {
				minp = 90,
				maxp = 100,
			},
		},
		
		AG = 
		{
			id=5143,
			icon=5143,
			casttime=2.25,
			prio=60,
			resource=0,
			selfbuff = {
				id = 79683,
				count = 1,
				proc = true,
			},	
		},
		arkanschlag4 = 
		{
			id=30451,
			icon=30451,
			casttime=1.5,
			prio=65,
			notselfdebuff = {
				id = 36032,
				count = 3,
			},	
			newdebuff = 36032,
			resource=870,
		},
		arkanbeschuss = 
		{
			id=44425,
			icon=44425,
			cd=3,
			casttime=1.5,
			prio=50,
			resource=1915,
		},
		arkanschlag5 = 
		{
			id=30451,
			icon=30451,
			casttime=1.5,
			prio=40,
			resource=870,
		},
	}
	facerolldb["MageFire_0"] = 
	{
		LB = 
		{
			id=44457,
			icon=44457,
			debuffid = 44457,
			casttime=1.5,
			ticktime=0,
			prio=100,
			resource=2961,
		},
		versengen = 
		{
			id=2948,
			icon=2948,
			debuffid = 22959,
			casttime=1.5,
			ticktime=0,
			prio=80,
		},
		pyroHT = 
		{
			id=92315,
			icon=92315,
			selfbuff = {
				id = 48108,
				count = 0,
				proc = true,
			},	
			casttime=1.5,
			prio=90,
		},
		Feuerball = 
		{
			id=133,
			icon=133,
			casttime=2.5,
			prio=50,
			resource=1567,
		},
	}
	facerolldb["MageFrost_0"] = 
	{

	}
	function arcaneblast_filter(j, prev_spell)
	
		local filter_arkanschlag = 
		{
			casttime=1.5,
			resource=0,
		}
	
		if (j["icon"] ~=  30451) then return true; end
		
		local i = ({UnitDebuff("player", GetSpellInfo(30451))})[4] or 0
		local resource = UnitPower("player")
		if (prev_spell) then
			if (prev_spell["icon"] ~=  30451) then 
				resource = resource - (prev_spell["resource"] or 0)
				filter_arkanschlag.resource =  prev_spell["resource"];
				filter_arkanschlag.casttime = prev_spell["casttime"]
			else
				resource = resource - (prev_spell["resource"] + i * 1305)
				i = i+1
				if i > 4 then
					i=4
				end
				filter_arkanschlag.resource = prev_spell["resource"] + i * 1305
			end
		else
			filter_arkanschlag.resource = 0;
		end
		if (resource >= ((j["resource"]+ i * 1305  ) or 0 ))then
			return power_filter(j, filter_arkanschlag);
		end
		return false
	end
faceroll_filter.arcaneblast_filter = arcaneblast_filter;
end
